Skip to content

Extended prompt support #281

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

DarkRaiderCB
Copy link

@DarkRaiderCB DarkRaiderCB commented Aug 9, 2025

feat: added list_mcp_prompts with test coverage


Why this is needed

MCP principles dictate that prompts are user-triggered. So, when an MCP server defines multiple prompts (e.g., 5 prompts), in client-side development, it’s important to allow users to discover available prompts.

Currently, without this feature, developers often:

  • Hardcode prompt names in load_mcp_prompt since user might not know what all prompts are available with the server,
  • Risk breaking the client if prompts are renamed or modified on the server.

This new list_mcp_prompts function:

  • Lists all available prompts from the connected MCP server,
  • Enables client applications to dynamically display prompt options to users,
  • Prevents hardcoding, ensuring that server-side changes won’t require client updates.

Example Use Case

A client app connects to an MCP server hosting several prompts.
Instead of hardcoding prompt names, the client can:

  1. Call list_mcp_prompts to retrieve all prompts.
  2. Let the user choose a prompt interactively.
  3. Pass the chosen prompt to load_mcp_prompt.

This matches the approach of apps like Claude Desktop, making the client more flexible and resilient to server changes.


Changes in this PR

  • Added list_mcp_prompts function to retrieve available prompts.
  • Added a test case to validate functionality.

@DarkRaiderCB
Copy link
Author

@eyurtsev Could you review this PR when you get a chance?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant